package com.yanqu.road.server.cmd.activity.shuihuyezicard;

import com.yanqu.road.pb.activity.ShuiHuYeZiCardProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.shuihuyezipai.ShuiHuYeZiCardActivityBattleMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @Description
 * @Author cwq
 * @Data 2021/12/7 18:05
 */
@Cmd(code = CrossProtocol.C_CROSS_SHUIHUYEZICARD_PLAY_CARD, desc = "水浒叶子牌 出牌")
public class CrossShuiHuYeZiCardPlayCardCmd extends CrossCommand {

    long userId;
    int id;
    int round;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        ShuiHuYeZiCardProto.ShuiHuYeZiCardPlayCardReqMsg reqMsg = ShuiHuYeZiCardProto.ShuiHuYeZiCardPlayCardReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        id = reqMsg.getId();
        round = reqMsg.getRound();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ShuiHuYeZiCardActivityBattleMgr.playCard(userId,serverId,id,round);
    }

    @Override
    public void sendData() {

    }
}
